﻿using Microsoft.Extensions.Primitives;
using Yarp.ReverseProxy.Configuration;

namespace ProxyServer.Yarp
{
    public class AppProxyConfig(
        List<RouteConfig> routes, 
        List<ClusterConfig> clusters, 
        IChangeToken changeToken) : IProxyConfig
    {

        public IReadOnlyList<RouteConfig> Routes => routes;

        public IReadOnlyList<ClusterConfig> Clusters => clusters;

        public IChangeToken ChangeToken => changeToken;

        public DateTimeOffset Applied { get; set; } = DateTimeOffset.UtcNow;
        public DateTimeOffset Removed { get; set; } = DateTimeOffset.UtcNow;
        public Guid SnapshotId { get; set; } = Guid.NewGuid();
    }
}
